package alkaid.eis.schedule.task;

import java.io.IOException;
import java.util.Map;

import org.springframework.stereotype.Component;

import alkaid.eis.common.util.ShellUtil;

/**
 * 命令行模拟任务
 * 
 * @author Lucky Yang
 * @since 0.0.1
 */
@Component
public class JavaVersionTask {

    public void execute() throws IOException, InterruptedException {
        ShellUtil.execute("java, -version", builder -> {
            // 自定义ProcessBuilder， 如设置环境变量
            Map<String, String> environment = builder.environment();
            environment.put("owner", "alkaid");
        });
    }

}
